---@class Battle.Config
Battle.EFFECT_PATH = "Prefab/Effect/battle/"
Battle.HERO_PATH = "Prefab/Hero/"
--region state
---人物行为状态
Battle.ActionState = {
    idle = 1,
    run = 2,
    attack = 3,
    failed = 4,
    win = 5,
    Hit = 6,
    Stun = 7,
}
Battle.ActionStateMapping = {
    [Battle.ActionState.idle] = Battle.IdleState,
    [Battle.ActionState.run] = Battle.RunState,
    [Battle.ActionState.attack] = Battle.AttackState,
    [Battle.ActionState.failed] = Battle.FailedState,
    [Battle.ActionState.win] = Battle.WinState,
    [Battle.ActionState.Hit] = Battle.HitState,
    [Battle.ActionState.Stun] = Battle.StunState,

}

Battle.BattleResultType = {
    Failed = 0,
    Success = 1
}
Battle.BattleStage = {
    Loading = 1,
    Init = 2,
    Run = 3,
    Accelerate = 4,
    Finished = 5,

    Result = 6,
}
Battle.ActorType = {

    Lord = 1, --
    Hero = 2,
    Dragon = 3,
    Tower = 4,
}
---阵营
Battle.CampType = {
    Blue = 1, --蓝方阵营
    Red = 2, --红方阵营
    Neutral = 3, --中立
}
---单位类型
Battle.UnitType = {
    Ground = 1,  --普通陆地
    Fly = 2,    --飞行
    Hide = 3,   --陆地隐身
}
--技能目标选择
Battle.SkillTargetRule = {
    Nearest = 1,        --最近
    LowAbsoluteHP = 2,  --绝对生命最低
    HighAtk = 3,        --攻击最高
}
---技能打断
Battle.SkillInterruptType = {
    Move = 1,     --移动打断
    control = 2,  --控制效果打断
    hit = 3,--受击打断
}

---来源
Battle.SourceType = {
    Skill = 1,
    Buffer = 2,
    Bullet = 3,
}
---体型
Battle.ShapeType = {
    Small = 1,
    Mid = 2,
    Big = 3
}
---属性计算类型
Battle.AttackAttrType = {
    Base = 1, --基础
    Penetration = 2, --穿透
    accurate = 3, --精准
}
--endregion state
--region 技能相关

---施法方式
Battle.ReleaseType = {
    Melee = 1, --近战
    Remote = 2, --远程(子弹)
    RemoteImmediate = 3, --远程(隔空瞬发)
}
---作用范围
Battle.SkillScopeType = {
    Self_Circle = 1, --自身为中心，对周围造成伤害，参数【半径】
    Self_Rect = 2, --自身为中心，对前方造成伤害，参数【长宽】
    Target_Circle = 3, --目标为中心，对目标周围造成伤害，参数【半径】
    HandCircle = 4, --手操圆，参数填写范围，一个数字表示半径，两个数值表示长宽
    Target_Follow = 5,--目标为中心，跟随移动
    HandLine = 6,   --手操直线
}
---范围类型
Battle.RangeSelectorType = {
    Sector = 1, --扇形区域
    Rect = 2,   --矩形区域
    Single = 3, --单点
}
---伤害类型
Battle.HurtType = {
    Common = 1, --普通伤害
    Holy = 2, --神圣伤害
    Treat = 3, --治疗
}
---伤害类型
Battle.DamageShowType = {
    None = 0,   --无
    Common = 1, --普通伤害
    Crit = 2,   --伤害暴击
    Treat = 3, --治疗
    Energy = 4,--能量
}
---子弹击中方式
Battle.BulletHitType = {
    Path = 1, --路径上敌人都伤害
    Target = 2, --命中目标
    FirstTarget = 3, --命中首个敌人
}
---子弹飞行方式
Battle.BulletFlyType = {
    Linear = 1, --直线
    Curve = 2, --曲线
}
---子弹伤害范围
Battle.BulletHurtRangeType = {
    Single = 1, --单体
    Circle = 2, --半径范围
}
Battle.SkillRangeType = {
    Single = 1, --单体
    Multi = 2,  --群体
}
Battle.EffectType = {
    effect = 1, --普通特效
    bullet = 2, --飞行道具
    rayEffect = 3,--射线
    BufferShow = 4,--普通buff特效
    BuffChain = 5,  --连接
    A2BRandom = 6,--随机
}
Battle.EffectMapping = {
    [Battle.EffectType.effect] = Battle.EffectBase,
    [Battle.EffectType.bullet] = Battle.BulletEffect,
    [Battle.EffectType.rayEffect] = Battle.RayEffect,
    [Battle.EffectType.BufferShow] = Battle.BuffShowEffect,
    [Battle.EffectType.BuffChain] = Battle.ChainEffect,
    [Battle.EffectType.A2BRandom] = Battle.AToBRandomPathEffect,
}
Battle.AreaType = {
    common = 1,
    mid = 2,
    midUp = 4,
    midDown = 8,
}
--动画播放id
Battle.AnimationConfig = {
    Idle = 1,
    Walk = 2,
    Attack = 3,
    Skill1 = 4,
    Skill2 = 5,
    Hit = 6,
    Die = 7,
}
--技能类型
Battle.SkillType = {
    Normal = 1;--普攻
    Active = 2;--主动
    Passive = 3;--被动技能
    Trigger = 4;--由其他技能触发的技能
}

--endregion 技能相关

--start Buff相关
--buff时机类型
Battle.BuffEventType = {
    START = 0,--技能开始
    PREPARE = 1,--技能前摇结束
    BACKSWING = 2,--技能后摇结束
}

--buff叠加类型
Battle.BuffSuperposition = {
    --- 1.叠加
    Superposition = 1,
    --- 2.并行
    Parallel = 2,
    --- 3.替换
    Replace = 3,

}
--buff触发时机
Battle.BuffTriggerType = {
    --- 0.不处理
    NONE = 0,
    --- 1.读帧
    FRAME = 1,
    --- 2.友方死亡
    FRIEND_DEAD = 2,
    --- 3.召唤英雄后
    HERO = 3,
    --- 4.添加时
    ADD = 4,
    --- 5.伤害前
    DAMAGE_FORT = 5,
    --- 6.伤害后
    DAMAGE_BACK = 6,
    --- 7.被伤害前
    HIT_DAMAGE_FORT = 7,
    --- 8.被伤害后
    HIT_DAMAGE_BACK = 8,
    --- 9.恢复生命时
    RECOVERY_HEAlTH = 9,
    --- 10.攻击前
    ATTACK_FORT = 10,
    --- 11.攻击后
    ATTACK_BACK = 11,
    ---12.友方回血
    FRIEND_RECOVERY_HEAlTH = 12,
    ---BUFF成功触发时
    ACTIVE = 17,
}


Battle.TriggerCondition ={
    Probability = 1,--概率
    --能量大于
    EnergyGreater  = 2,
    --携带标记
    CarryMark = 3,
    --目标隐形
    TargetHide = 4,
    --间隔触发
    TimeInterval = 5,
    --生命值低于万分比
    SelfHpLowPer = 6,
    --触发次数限制
    ActiveCountLimit = 7,
    --能量小于
    --Energy less
}
--end buff相关
local cfg
local GlobalConfig = { }
Battle.GlobalConfig = GlobalConfig
function GlobalConfig.GetInt(id)
    if not cfg then
        cfg = DataTable.Get("t_parameter")
    end
    return cfg[id].f_int_value
end
function GlobalConfig.GetString(id)
    if not cfg then
        cfg = DataTable.Get("t_parameter")
    end
    return cfg[id].f_string_value
end

